﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Checkpoint2XNA.Models.Chess
{
    public class Rook : Model3D
    {
        const float WIDTH_MODIFIER = .5f;
        const float LENGTH_MODIFIER = WIDTH_MODIFIER;
        const float HEIGHT_MODIFIER = 1;

        public Box Box;

        public Rook(Vector3 p, float size, ChessSide c): base(p, c)
        {
            Box = new Box(p, size * WIDTH_MODIFIER, size * LENGTH_MODIFIER, size * HEIGHT_MODIFIER, Color);
        }

        public override void MoveTo(Vector3 point)
        {
            Box.MoveTo(point);
            CenterBottom = point;
        }

        public override Microsoft.Xna.Framework.Color GetColorAt(Microsoft.Xna.Framework.Vector3 point)
        {
            return Color;
        }

        public override Microsoft.Xna.Framework.Vector3 GetNormal(Microsoft.Xna.Framework.Vector3 point)
        {
            return Box.GetNormal(point);
        }

        public override double RayCollide(Microsoft.Xna.Framework.Vector3 origin, Microsoft.Xna.Framework.Vector3 normalVector)
        {
            return Box.RayCollide(origin, normalVector);
        }
    }
}
